// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import '@/styles/reset.css'
import '@/styles/iconfont.css'
import VuePreview from 'vue-preview'
import Postcss from 'postcss-px2rem-exclude'
import store from '@/store'

// defalut install
Vue.use(VuePreview) // 启用图片缩略图
Vue.use(MintUI) // 启用框架
Vue.use(Postcss) // 启用移动端适配
// 创建全局时间过滤器
Vue.filter('fmtTime', function (timeStr) {
  let timeObj = new Date(timeStr)
  let y = timeObj.getFullYear()
  let m = timeObj.getMonth() + 1
  let d = timeObj.getDate()
  return y + '/' + m + '/' + d
})

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  store,
  router,
  components: { App },
  template: '<App/>'
})
